package com.liveinstars.common.ticker;

/**
 * 交易所交易对模型
 * Created by guoyanjiang on 2019-01-28.
 */
public class ExchangePairDTO extends BaseExchangePair{

    private String coinKey;
    private String currencyShow;
    private ExchangeCurrency exchangeCurrency;

    public ExchangePairDTO(String exchangeKey, String pair, String coinKey, String currencyShow) {
        super(exchangeKey, pair);
        this.coinKey = coinKey;
        this.currencyShow = currencyShow;
        this.exchangeCurrency = new ExchangeCurrency(exchangeKey, provideCoinCurrencyUnitInPair());
    }

    public ExchangePairDTO(String exchangeKey, BasePair basePair, String coinKey, String currencyShow) {
        super(exchangeKey, basePair.providePairStr());
        this.coinKey = coinKey;
        this.currencyShow = currencyShow;
        this.exchangeCurrency = new ExchangeCurrency(exchangeKey, provideCoinCurrencyUnitInPair());
    }

    public String getCoinKey() {
        return coinKey;
    }

    public String getCurrencyShow() {
        return currencyShow;
    }

    public ExchangeCurrency getExchangeCurrency() {
        return exchangeCurrency;
    }

    public String provideShowPair() {
        return String.format("%s/%s", provideCoinSymbolInPair(), currencyShow).toUpperCase();
    }
}
